
// clip space pos to screen texture coord.
float4 _HPosToScreenTC(float4 HPos)
{
	float4 ScrTC = HPos;		// clip space 
	// [-1 1] --> [0 1]
	ScrTC.xy = (HPos.xy * float2(1,-1) + HPos.ww  ) * 0.5;

	// No offsets required in d3d10
#if !D3D10 && !PS3
	ScrTC.xy += g_VS_ScreenSize.zw*HPos.w;
#endif

	return ScrTC;
}